aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2024-04-26 22:08:32 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2024-04-26 22:08:32 +0200
commit046cd9f8760b48d86389b4b67e58d2b24966cc4f (patch)
tree607bcc43632b9f8fd46132b174388719a7aa354f
parent89941ca62351ceb6d0c7e79b5a6081fc4a394e72 (diff)
downloadgnunet-master.tar.gz
gnunet-master.zip
RECLAIM: Fix ticket consume flowHEADmaster
m---------contrib/gana0
m---------contrib/handbook0
-rw-r--r--src/service/reclaim/gnunet-service-reclaim.c1
-rw-r--r--src/service/reclaim/reclaim_api.c2
-rw-r--r--src/service/rest/oidc_helper.c12
-rw-r--r--src/service/rest/oidc_helper.h4
-rw-r--r--src/service/rest/openid_plugin.c2
7 files changed, 11 insertions, 10 deletions
diff --git a/contrib/gana b/contrib/gana
Subproject e6540cf597091eabaa732826d5ad1185f4bcc5c Subproject 53d0992890e1ebb8f8c6bd747533abe157baec6
diff --git a/contrib/handbook b/contrib/handbook
Subproject 7d66dc1695829f2511f8e8ecc227a64d73d1562 Subproject c309e416984fc76e4b39adcbd4e8a602d94b198
diff --git a/src/service/reclaim/gnunet-service-reclaim.c b/src/service/reclaim/gnunet-service-reclaim.c
index 368e39ec3..a9a427d90 100644
--- a/src/service/reclaim/gnunet-service-reclaim.c
+++ b/src/service/reclaim/gnunet-service-reclaim.c
@@ -1025,6 +1025,7 @@ handle_consume_ticket_message (void *cls, const struct ConsumeTicketMessage *cm)
1025 1025
1026 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CONSUME_TICKET message\n"); 1026 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received CONSUME_TICKET message\n");
1027 tkt_len = ntohs (cm->tkt_len); 1027 tkt_len = ntohs (cm->tkt_len);
1028 buf = (char*) &cm[1];
1028 if ((GNUNET_SYSERR == 1029 if ((GNUNET_SYSERR ==
1029 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len, 1030 GNUNET_RECLAIM_read_ticket_from_buffer (buf, tkt_len,
1030 &ticket, &read)) || 1031 &ticket, &read)) ||
diff --git a/src/service/reclaim/reclaim_api.c b/src/service/reclaim/reclaim_api.c
index 0fe49c37d..92e240587 100644
--- a/src/service/reclaim/reclaim_api.c
+++ b/src/service/reclaim/reclaim_api.c
@@ -1782,7 +1782,7 @@ GNUNET_RECLAIM_write_ticket_to_buffer (const struct
1782 return written; 1782 return written;
1783 left -= written; 1783 left -= written;
1784 tmp += written; 1784 tmp += written;
1785 memcpy (&tmp, tkt->rp_uri, strlen (tkt->rp_uri) + 1); 1785 memcpy (tmp, tkt->rp_uri, strlen (tkt->rp_uri) + 1);
1786 written = strlen (tkt->rp_uri) + 1; 1786 written = strlen (tkt->rp_uri) + 1;
1787 left -= written; 1787 left -= written;
1788 tmp += written; 1788 tmp += written;
diff --git a/src/service/rest/oidc_helper.c b/src/service/rest/oidc_helper.c
index 810e4e264..15133b270 100644
--- a/src/service/rest/oidc_helper.c
+++ b/src/service/rest/oidc_helper.c
@@ -211,7 +211,8 @@ generate_userinfo_json (const struct GNUNET_CRYPTO_PublicKey *sub_key,
211 pres_val_str = 211 pres_val_str =
212 GNUNET_RECLAIM_presentation_value_to_string (ple->presentation->type, 212 GNUNET_RECLAIM_presentation_value_to_string (ple->presentation->type,
213 ple->presentation->data, 213 ple->presentation->data,
214 ple->presentation->data_size); 214 ple->presentation->data_size)
215 ;
215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
216 "Presentation is: %s\n", pres_val_str); 217 "Presentation is: %s\n", pres_val_str);
217 json_object_set_new (aggr_sources_jwt, 218 json_object_set_new (aggr_sources_jwt,
@@ -370,7 +371,6 @@ generate_id_token_body (const char *rp_uri,
370 struct GNUNET_TIME_Absolute exp_time; 371 struct GNUNET_TIME_Absolute exp_time;
371 struct GNUNET_TIME_Absolute time_now; 372 struct GNUNET_TIME_Absolute time_now;
372 json_t *body; 373 json_t *body;
373 char *audience;
374 char *subject; 374 char *subject;
375 char *body_str; 375 char *body_str;
376 376
@@ -413,7 +413,6 @@ generate_id_token_body (const char *rp_uri,
413 413
414 json_decref (body); 414 json_decref (body);
415 GNUNET_free (subject); 415 GNUNET_free (subject);
416 GNUNET_free (audience);
417 416
418 return body_str; 417 return body_str;
419} 418}
@@ -470,6 +469,7 @@ OIDC_generate_id_token_rsa (const char *rp_uri,
470 return result; 469 return result;
471} 470}
472 471
472
473char * 473char *
474OIDC_generate_id_token_hmac (const char *rp_uri, 474OIDC_generate_id_token_hmac (const char *rp_uri,
475 const struct GNUNET_CRYPTO_PublicKey *sub_key, 475 const struct GNUNET_CRYPTO_PublicKey *sub_key,
@@ -676,9 +676,9 @@ OIDC_build_authz_code (const struct GNUNET_CRYPTO_PrivateKey *issuer,
676 // Sign and store signature 676 // Sign and store signature
677 if (GNUNET_SYSERR == 677 if (GNUNET_SYSERR ==
678 GNUNET_CRYPTO_sign_ (issuer, 678 GNUNET_CRYPTO_sign_ (issuer,
679 purpose, 679 purpose,
680 (struct GNUNET_CRYPTO_Signature *) 680 (struct GNUNET_CRYPTO_Signature *)
681 buf_ptr)) 681 buf_ptr))
682 { 682 {
683 GNUNET_break (0); 683 GNUNET_break (0);
684 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n"); 684 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unable to sign code\n");
diff --git a/src/service/rest/oidc_helper.h b/src/service/rest/oidc_helper.h
index d3988f421..08aedc2ed 100644
--- a/src/service/rest/oidc_helper.h
+++ b/src/service/rest/oidc_helper.h
@@ -95,7 +95,7 @@ OIDC_generate_id_token_hmac (const char *rp_uri,
95 * Builds an OIDC authorization code including 95 * Builds an OIDC authorization code including
96 * a reclaim ticket and nonce 96 * a reclaim ticket and nonce
97 * 97 *
98 * @param rp_uri the RP URI 98 * @param issuer the issuer
99 * @param ticket the ticket to include in the code 99 * @param ticket the ticket to include in the code
100 * @param attrs list of attributes to share 100 * @param attrs list of attributes to share
101 * @param presentations credential presentation list 101 * @param presentations credential presentation list
@@ -105,7 +105,7 @@ OIDC_generate_id_token_hmac (const char *rp_uri,
105 * @return a new authorization code (caller must free) 105 * @return a new authorization code (caller must free)
106 */ 106 */
107char* 107char*
108OIDC_build_authz_code (const char *rp_uri, 108OIDC_build_authz_code (const struct GNUNET_CRYPTO_PrivateKey *issuer,
109 const struct GNUNET_RECLAIM_Ticket *ticket, 109 const struct GNUNET_RECLAIM_Ticket *ticket,
110 const struct GNUNET_RECLAIM_AttributeList *attrs, 110 const struct GNUNET_RECLAIM_AttributeList *attrs,
111 const struct 111 const struct
diff --git a/src/service/rest/openid_plugin.c b/src/service/rest/openid_plugin.c
index b9e5a08e6..5fc98465a 100644
--- a/src/service/rest/openid_plugin.c
+++ b/src/service/rest/openid_plugin.c
@@ -2265,7 +2265,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2265 } 2265 }
2266 2266
2267 // decode code 2267 // decode code
2268 if (GNUNET_OK != OIDC_parse_authz_code (&cid, code, code_verifier, &ticket, 2268 if (GNUNET_OK != OIDC_parse_authz_code (ticket.rp_uri, code, code_verifier, &ticket,
2269 &cl, &pl, &nonce, 2269 &cl, &pl, &nonce,
2270 OIDC_VERIFICATION_DEFAULT)) 2270 OIDC_VERIFICATION_DEFAULT))
2271 { 2271 {